/***************************************************************************
 *   Copyright (C) 2007 by Harm van Eersel                                 *
 *   devsciurus@xs4all.nl                                                  *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include "periodictablewidget.h"
#include "element.h"

PeriodicTableWidget::PeriodicTableWidget()
{
  // Setting properties
  setViewMode(QListView::IconMode);
//   setGridSize(QSize(50,50));
  setDragEnabled(false);
//     setDragDropMode(QAbstractItemView::DragOnly);
  setMovement(QListView::Static);
  setUniformItemSizes(true);
  setResizeMode(QListWidget::Adjust);
  setMinimumWidth(275);
//     setFlow(QListWidget::TopToBottom);
//     setLayoutMode(QListWidget::SinglePass);
//     setWrapping(false);
//   setAlternatingRowColors(true);
//   setModelColumn(3);

  // Setting appereance
  setFont(QFont("Courier",10));

  // Adding elements
  QStringList elList;
  elList << "H" << "Li" << "Na" << "K" << "Rb" << "Cs" << "Fr" << "  " << "  ";
  elList << "  " << "Be" << "Mg" << "Ca" << "Sr" << "Ba" << "Ra" << "  " << "  ";
  elList << "  " << "  " << "  " << "Sc" << "Y" << "La" << "Ac" << "  " << "  ";
  elList << "  " << "  " << "  " << "Ti" << "Zr" << "Hf" << "Rf" << "Ce" << "Th";
  elList << "  " << "  " << "  " << "V" << "Nb" << "Ta" << "Db" << "Pr" << "Pa";
  elList << "  " << "  " << "  " << "Cr" << "Mo" << "W" << "Sg" << "Nd" << "U";
  elList << "  " << "  " << "  " << "Mn" << "Tc" << "Re" << "Bh" << "Pm" << "Np";
  elList << "  " << "  " << "  " << "Fe" << "Ru" << "Os" << "Hs" << "Sm" << "Pu";
  elList << "  " << "  " << "  " << "Co" << "Rh" << "Ir" << "Mt" << "Eu" << "Am";
  elList << "  " << "  " << "  " << "Ni" << "Pd" << "Pt" << "Ds" << "Gd" << "Cm";
  elList << "  " << "  " << "  " << "Cu" << "Ag" << "Au" << "Rg" << "Tb" << "Bk";
  elList << "  " << "  " << "  " << "Zn" << "Cd" << "Hg" << "  " << "Dy" << "Cf";
  elList << "  " << "B" << "Al" << "Ga" << "In" << "Tl" << "  " << "Ho" << "Es";
  elList << "  " << "C" << "Si" << "Ge" << "Sn" << "Pb" << "  " << "Er" << "Fm";
  elList << "  " << "N" << "P" << "As" << "Sb" << "Bi" << "  " << "Tm" << "Md";
  elList << "  " << "O" << "S" << "Se" << "Te" << "Po" << "  " << "Yb" << "No";
  elList << "  " << "F" << "Cl" << "Br" << "I" << "At" << "  " << "Lu" << "Lr";
  elList << "He" << "Ne" << "Ar" << "Kr" << "Xe" << "Rn" << "  " << "  " << "  ";
//   for (int i = 1; i <= molsKetch::getSize(); i++) elList << molsKetch::number2symbol(i);
  addItems(elList);
  
  setResizeMode(QListWidget::Fixed);
  
}
